<!--
* @description  参数1
* @fileName  TopBar
* @author userName
* @date 2024-01-02 15:34:12
* @version V1.0.0
!-->

<template>
  <div id="TopBar">
    <div class="topbar_wrapper">
      <img src="" alt="" />
      <div class="tarbar_control">
        <span @click="hideHandle">最小化</span>
        <span @click="bigHandle">缩小/放大</span>
        <span @click="closeHandle">关闭</span>
      </div>
    </div>

  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
  name: 'TopBar',
  setup() {
    const hideHandle = () => {
      window.electron.ipcRenderer.invoke('window:hide')
      console.log('ad')
    }

    const closeHandle = ()=>{
      window.electron.ipcRenderer.invoke('window:close')
    }

    const bigHandle = ()=>{
      window.electron.ipcRenderer.invoke('window:change')
    }
    return { hideHandle,closeHandle,bigHandle }
  }
})
</script>

<style lang="less" scoped>
#TopBar {
  -webkit-app-drag: drag;
  .topbar_wrapper {
    display: flex;
    height: 5%;
    justify-content: space-between;
    background: #fff;
    .tarbar_control {
      & > span {
        width: 80px;
        height: 40px;
        margin-left: 10px;
        cursor: pointer;
      }
    }
  }
}
</style>
